Skip to content

fix(cli): resolve 6 bugs found during E2E testing#110

Merged
eddietejeda merged 5 commits into
mainfrom
fix/e2e-bugs
May 27, 2026
Merged

fix(cli): resolve 6 bugs found during E2E testing#110
eddietejeda merged 5 commits into
mainfrom
fix/e2e-bugs

Conversation

@eddietejeda
Copy link
Copy Markdown
Contributor

Summary

  • datasets create: add missing -o/--output flag; move "Dataset created" banner to stderr so -o json output is jq-parseable
  • sandbox new: move "Sandbox created" banner to stderr for the same reason
  • sandbox read: use println! instead of print! to ensure a trailing newline
  • sandbox delete: add new sandbox delete <id> subcommand (DELETE /sandboxes/{id})
  • workspaces set: fix incorrect lock check — was checking HOTDATA_WORKSPACE (always set in sandbox runs), now correctly checks HOTDATA_SANDBOX; update error message
  • context push: switch from api.post() to api.post_raw() and intercept "not allowed within a session" errors with a helpful hint pointing users to hotdata sandbox set (no args) to clear the active sandbox

- datasets create: add missing -o/--output flag; move banner to stderr
- sandbox new: move "Sandbox created" banner to stderr so -o json is parseable
- sandbox read: use println! instead of print! to ensure trailing newline
- sandbox: add delete subcommand (DELETE /sandboxes/{id})
- workspaces set: check HOTDATA_SANDBOX instead of HOTDATA_WORKSPACE; update error message
- context push: surface friendly hint when server blocks push inside an active sandbox
@sentry
Copy link
Copy Markdown

sentry Bot commented May 25, 2026

Codecov Report

❌ Patch coverage is 1.49254% with 66 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/sandbox.rs 4.34% 22 Missing ⚠️
src/context.rs 0.00% 19 Missing ⚠️
src/datasets.rs 0.00% 18 Missing ⚠️
src/main.rs 0.00% 5 Missing ⚠️
src/workspace.rs 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment thread src/sandbox.rs
Comment thread src/sandbox.rs
Comment thread src/context.rs
Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Blocking Issues

  • src/sandbox.rs:343sandbox delete does not clear the cached sandbox session or the config.sandbox pointer when the deleted sandbox is the active one. After sandbox newsandbox delete <id>, subsequent commands keep using the now-stale sandbox JWT and surface confusing API errors until the user manually runs sandbox set (no args).

Action Required

  • In sandbox::delete, after a successful DELETE, check whether the deleted id is the active sandbox (config::load("default")?.sandbox) and, if so, call sandbox_session::clear() and config::clear_sandbox("default") — mirroring the cleanup sandbox::set(None, ..) already does.

- sandbox update: move "Sandbox updated" banner to eprintln! (stderr)
  so -o json stdout is clean — same fix as sandbox new
- scripts/test_commands.sh: new comprehensive functional test script
  covering all 128 command/subcommand/flag/output-format combinations,
  with real API calls, resource lifecycle, and cleanup
Comment thread src/sandbox.rs
Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Blocking Issues

  • src/sandbox.rs:343sandbox delete still does not clear the cached sandbox session or config.sandbox when the deleted id is the active one. This was flagged as blocking in cycle 1 and has not been addressed; subsequent commands will keep routing through a sandbox JWT for a server-side-deleted sandbox until the user manually runs sandbox set.

Action Required

  • After the successful DELETE in sandbox::delete, load the active sandbox from config::load("default") and, if it matches sandbox_id, call sandbox_session::clear() and config::clear_sandbox("default") — mirroring the cleanup sandbox::set(None, ..) already performs.

When the deleted sandbox is the currently active one (tracked via
HOTDATA_SANDBOX env var or config.sandbox), clear the cached sandbox
session and config pointer so subsequent commands do not keep routing
through a stale JWT -- mirrors what sandbox set (no args) already does.
Add check_sandbox_lock() to sandbox::delete for consistency with new,
run, and set -- prevents silently deleting the sandbox you are currently
running inside.
claude[bot]
claude Bot previously approved these changes May 27, 2026
Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking issue from prior cycles (clearing cached sandbox session on active-sandbox delete) is resolved in src/sandbox.rs:356-364.

claude[bot]
claude Bot previously approved these changes May 27, 2026
@eddietejeda eddietejeda merged commit 5a10d13 into main May 27, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant